package com.gupao.triple.consumer.triplesampleconsumer;

import org.apache.dubbo.config.annotation.DubboReference;
import org.gupao.triple.example.HelloReply;
import org.gupao.triple.example.HelloRequest;
import org.gupao.triple.example.IHelloService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author: Mic
 * @公众号： 跟着Mic学架构
 * @官网： https://ke.gupaoedu.cn
 * @Org: 咕泡教育
 **/
@RestController
public class HelloController {

    @DubboReference
    IHelloService helloService;

    @GetMapping("/say")
    public String say(){
        HelloRequest request=HelloRequest.newBuilder().setName("Mic").build();
        HelloReply reply=helloService.say(request);
        return reply.getMessage();
    }
}
